/*
 * UserComparator.java
 */

package model;

import java.util.Comparator;

/**
 * Comparator class for User objects. Used for sorting
 * User objects according to their last name alphabetically.
 * 
 * @author Sean Brown
 * @version 1.0
 */
public class UserComparator implements Comparator<User> {

	/**
	 * Overridden compar method for Comparator.  
	 * @param the_first the first User.
	 * @param the_second the second User.
	 * @return the value for determining which User's
	 * last name comes first alphabetically.
	 */
	@Override
	public int compare(final User the_first, final User the_second) {
		return the_first.getLastName().
				compareTo(the_second.getLastName());
	}

}
